package com.csw.shuanfa.SuanFa;

import java.util.HashMap;
import java.util.Map;

public class T1 {
    /**
     * 1  1
     * 2  2 3
     * 3  6 9
     *
     * @param args
     */
    public static void main(String[] args) {
        int n = 5;
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int sum0 = judge(i, 1, 1);
            sum = sum + sum0;

        }
        //sum);
    }

    private static int judge(int i, int a, int sum) {

        sum = sum * a;
        a = a + 1;
        if (a <= i) {
            int res = judge(i, a, sum);
            return res;
        }
        return sum;
    }

}

class T1_1 {
    public static void main(String[] args) {
        int n = 3;
        int sum = 0;
        Map map = new HashMap();
        map.put("a", 1);
        for (int i = 1; i <= n; i++) {
            int a = Integer.parseInt(map.get("a").toString()) * i;
            map.put("a", a);
            sum = sum + a;
        }
        //sum);
    }
}

